$(document).ready(function(){
var i=0;
	$(".arrowRight").click(function(){
		if(i<5){
		$("li:eq("+i+")").css("background-color","#333333");
		$("li:eq("+(++i)+")").css("background-color","orange");
		}else{
			$("li:eq(5)").css("background-color","orange");
			++i;
		}
		if(i==1){
			$(".adver").css("background","url(img/adver02.jpg)");
		}else if(i==2){
			$(".adver").css("background","url(img/adver03.jpg)");
		}else if(i==3){
			$(".adver").css("background","url(img/adver04.jpg)");
		}else if(i==4){
			$(".adver").css("background","url(img/adver05.jpg)");
		}else if(i==5){
			$(".adver").css("background","url(img/adver06.jpg)");
		}else if(i==6){
			alert("已经是最后一张图片了");
		 --i;
		}
	})
	$(".arrowLeft").click(function(){
		if(i>0){
		$("li:eq("+i+")").css("background-color","#333333");
		$("li:eq("+(--i)+")").css("background-color","orange");
		}else{
			$("li:eq(0)").css("background-color","orange");
			--i;
		}
		if(i==1){
			$(".adver").css("background","url(img/adver02.jpg)");
		}else if(i==2){
			$(".adver").css("background","url(img/adver03.jpg)");
		}else if(i==3){
			$(".adver").css("background","url(img/adver04.jpg)");
		}else if(i==4){
			$(".adver").css("background","url(img/adver05.jpg)");
		}else if(i==-1){
			alert("已经是最后一张图片了");
			 ++i;
		}else if(i==0){
			$(".adver").css("background","url(img/adver01.jpg)");
		}
	})
	$(".adver").mouseover(function(){
		$(".arrowLeft").css("display","block");
		$(".arrowRight").css("display","block");
	})
})
